package com.easa.entity;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;

@Entity
public class Semester {
    private String semesterId;
    private String semesterName;
    private String semesterStartDate;
    private String semesterEndDate;
    private Integer weekQuantity;

    @Id
    @Column(name = "semesterId")
    public String getSemesterId() {
        return semesterId;
    }

    public void setSemesterId(String semesterId) {
        this.semesterId = semesterId;
    }

    @Basic
    @Column(name = "semesterName")
    public String getSemesterName() {
        return semesterName;
    }

    public void setSemesterName(String semesterName) {
        this.semesterName = semesterName;
    }

    @Basic
    @Column(name = "semesterStartDate")
    public String getSemesterStartDate() {
        return semesterStartDate;
    }

    public void setSemesterStartDate(String semesterStartDate) {
        this.semesterStartDate = semesterStartDate;
    }

    @Basic
    @Column(name = "semesterEndDate")
    public String getSemesterEndDate() {
        return semesterEndDate;
    }

    public void setSemesterEndDate(String semesterEndDate) {
        this.semesterEndDate = semesterEndDate;
    }

    @Basic
    @Column(name = "weekQuantity")
    public Integer getWeekQuantity() {
        return weekQuantity;
    }

    public void setWeekQuantity(Integer weekQuantity) {
        this.weekQuantity = weekQuantity;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Semester semester = (Semester) o;

        if (semesterId != null ? !semesterId.equals(semester.semesterId) : semester.semesterId != null) return false;
        if (semesterName != null ? !semesterName.equals(semester.semesterName) : semester.semesterName != null)
            return false;
        if (semesterStartDate != null ? !semesterStartDate.equals(semester.semesterStartDate) : semester.semesterStartDate != null)
            return false;
        if (semesterEndDate != null ? !semesterEndDate.equals(semester.semesterEndDate) : semester.semesterEndDate != null)
            return false;
        if (weekQuantity != null ? !weekQuantity.equals(semester.weekQuantity) : semester.weekQuantity != null)
            return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = semesterId != null ? semesterId.hashCode() : 0;
        result = 31 * result + (semesterName != null ? semesterName.hashCode() : 0);
        result = 31 * result + (semesterStartDate != null ? semesterStartDate.hashCode() : 0);
        result = 31 * result + (semesterEndDate != null ? semesterEndDate.hashCode() : 0);
        result = 31 * result + (weekQuantity != null ? weekQuantity.hashCode() : 0);
        return result;
    }
}
